/**
 * Created by YIn on 2017/12/4.
 */
var proportion = echarts.init(document.getElementById('proportion'));

//echarts 配置
option = {
    // backgroundColor: '#f90',
    color: ['#ff9900', '#5ab1ef', '#fbc89f'],
    title : {
        text: '计 算 量 分 布',
        textStyle: {
            color: '#fff'
        },
        // subtext: '南丁格尔玫瑰图',
        x:'center',
        y:'8%'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} ({d}%)"
    },
    legend: {
        x : 'center',
        y : 'bottom',
        data:['江苏','安徽','成都']
    },
    toolbox: {
        show : false,
        feature : {
            mark : {show: true},
            dataView : {show: true, readOnly: false},
            magicType : {
                show: true,
                type: ['pie', 'funnel']
            },
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    calculable : true,
    series : [
        {
            name:'计算量分布占比',
            type:'pie',
            radius : ['22%', '78%'],
            center : ['50%', '60%'],
            roseType : 'radius',
            label: {
                normal: {
                    color: '#fff'
                }
            },
            // itemStyle: {
            //     normal: {
            //         color: ['#fd9173', '#5f71d2', '#4ac7f5']
            //     }
            // },
            data:[
                {value:1976, name:'江苏 2976'},
                {value:1092, name:'安徽 1092'},
                {value:241, name:'成都 241'}
            ]
        }
    ]
};

proportion.setOption(option);

window.addEventListener("resize", function () {
    proportion.resize();
});